var log4js = require("log4js");
// var logger = log4js.getLogger();
// logger.level = "debug";
log4js.configure({
    appenders: { cheese: { type: "file", filename: "cheese.log" } },
    categories: { default: { appenders: ["cheese"], level: "error" } },
});

var logger = log4js.getLogger('cheese');
logger.level = "debug";

const url = require('url')
const urlObj={
    protocol: 'http:',
    slashes: true,
    auth: null,
    host: 'www.baidu',
    port: null,
    hostname: 'www.baidu',
    hash: '#tag=3',
    search: '?id=2',
    query: 'id=2',
    pathname: '/com:443/path/index.html',
    path: '/com:443/path/index.html?id=2',
    href: 'http://www.baidu/com:443/path/index.html?id=2#tag=3'
  }
  
const urlString = 'http://www.baidu/com:443/path/index.html?id=2#tag=3'

// logger.debug(url.parse(urlString))
// logger.debug(url.format(urlObj))
// logger.debug(url.resolve('http://www.abc.com/a','../'))
// logger.debug(url.resolve('http://www.abc.com/a','/b'))
const urlParams= new URLSearchParams(url.parse(urlString).search)
logger.debug(urlParams.get('id'))
